package cn.edu.ctbu.studentmanage.domain;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *  针对tb_student的实体类
 */
//取对象命一般小写
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity(name = "tb_student")
public class Student {
    /**
     * 序号
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer sid;
    /**
     * 学号
     */
    @NotNull
    @Size(min = 10,max = 10,message="学号必须为10个字符")
    private String sno;

    /**
     * 姓名
     */
    @NotNull
    private String sname;

    /**
     * 性别，男，女
     */
    private String ssex;

    /**
     * 所在院系
     */
    private String sdept;

    /**
     * 年龄
     */
    private Integer age;


    /**
     * 密码
     */
    private String spassword;
}
